//============================================================================
// Copyright (C) 2003-2013 Brett R. Jones 
// All Rights Reserved
//
// You may redistribute and/or modify for non commercial and commercial uses 
// provided this copyright notice remains in place and is not modified
//
// This code is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
//
// brettjones1900@gmail.com
// http://www.p2panarchy.com
//============================================================================

#define PKT_ACCT_CREATE_MAX_NAME_LEN 31
class PktAcctCreateReq: public VxPktHdr
{
public:
	PktAcctCreateReq()
	{
		m_u16PktLen = sizeof( PktAcctCreateReq );
		m_u16PktType = PKT_TYPE_ACCT_CREATE_REQ;
		u16Res = 0;
		as8UserName[0] = 0;
		memset( au8Key, 0, sizeof( au8Key ));
	}
	void CalcPktLen( void )
	{
		U32 u32DataLen = (U32)strlen( as8UserName ) + 1;
		//calculate length of packet from length of file data
		m_u16PktLen = (unsigned short)ROUND_TO_16BYTE_BOUNDRY( sizeof( PktAcctCreateReq ) - (PKT_ACCT_CREATE_MAX_NAME_LEN + 1)  + u32DataLen );
	}

	U16				u16Res;							// reserved 
	U8				au8Key[CHEEZY_SYM_KEY_LEN];		// hashed key
	char			as8UserName[ PKT_ACCT_CREATE_MAX_NAME_LEN + 1 ];// user login name
};

